<template>
  <div>
    <el-container v-if="true">
      <el-aside width="250px">
        <div>
          <img
            src="@/assets/logo.png"
            alt="公司的图标"
            class="business_logo">
        </div>
        <div v-if="menu_root==0"
          class="personal_position">
          <img
            src="@/assets/员工.png"
            alt="个人的头像"
            class="personal_logo">
        </div>
        <div v-if="menu_root==1"
          class="personal_position">
          <img
            src="@/assets/经理人.png"
            alt="个人的头像"
            class="personal_logo">
        </div>
        <div class="personal_name">
          <p>{{personalName}}</p>
        </div>
        <el-menu
          :default-active="defaultActive"
          router>
          <el-menu-item
            v-for="(item, index) in fullMenu"
            :index="item.pathname"
            :key="index"
            class="menu"
            v-if="menu_root==item.show || item.show==2">
            <span slot="title">{{ item.name }}</span>
          </el-menu-item>
        </el-menu>
      </el-aside>
      <el-main>
        <router-view/>
      </el-main>
    </el-container>

  </div>

</template>

<script>
export default {
    data() {
        return {
          application:[],
            fullMenu: [
              {
                show: 2,
                name: '欢迎使用',
                pathname: '/welcome'
              },
                {
                  show: 1,
                   name: '团队请假统计',
                   pathname: '/team_vocation'
               }, {
                show: 1,
                   name: '待审批请假单',
                   pathname: '/team_approval'
               }, {
                show: 0,
                name: '个人请假信息',
                pathname: '/personal_vocation'
              }, {
                show: 0,
                name: '个人待审批请假单',
                pathname: '/personal_approval'
              }, {
                show: 0,
                name: '团队请假信息',
                pathname: '/personal_check'
              }
            ]
        }
    },
    props: ['menu_root'],
    computed: {
        defaultActive() {
            return this.$route.path
        },
        data(){
          return{
            personalName: "aaa"
          }
        }
    },
  methods: {
  }
}
</script>

<style lang="css">
.menu {
    text-align: center;
    font-size: 16px;
}
.business_logo {
  width: 60%;
}
.personal_position {
  text-align: center;
}
.personal_logo {
  width: 30%;
  height: 30%;
}
.personal_name {
  text-align: center;
  font-size: 16px;
}
</style>
